﻿//修改信息
var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    const_EditEntity = "hrEmployee";
    var deptId = record.getData("DeptID");
    var deptName = record.getData("DeptName");
    var postName = record.getData("PostName");
    var pagetitle = "修改在职员工信息—" + record.getData("CName");
    parent._employeeTitle = pagetitle;

    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID) + "&deptId=" + deptId + "&deptName=" + deptName + "&postName=" + postName + "&type=1"));
    parent.NeedRefreshPage = this;
}

///把待岗员工恢复为在职   2014-08-25 18:32:32 V_hrEmployee_DaiGang
var fnFanGang = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }

    if (confirm("确认要把员工 " + record.getData("CName") + "  的状态改为在职？")) {
        var url = encodeURI("../../Crm/BSendSysNews.ashx?num=fanGang&ID=" + record.getData(const_entityID) + "&r=" + Math.random());
        $.get(url, function (d, s) {
            if (d > 0) {
                alert("员工  " + record.getData("CName") + "  状态改为在职，操作成功");
            } else {
                alert("操作出现异常，员工  " + record.getData("CName") + "  状态改为在职，操作失败");
            }
        });
    }
}